UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WN0rR6pAxsQey1Z8Br5kFhjTFNPIMc43BiSfxPFYes='
WHERE
key_id = 'f6b86d4c0acbd5c6dae94d85ea23fc6104232cade8119cef84796ace1d5a2765'
AND (
token = '2WN0rR6pAxsQey1Z8Br5kFhjTFNPIMc43BiSfxPFYes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)