UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uAjwtXU80mDZn3tCTW25gTyCCKrbT/gJxwD1s1LG19k='
WHERE
key_id = '633f56d5a57b4daf868734eddefcbfac1a168e4cda2c539a522e9ed89d309450'
AND (
token = 'uAjwtXU80mDZn3tCTW25gTyCCKrbT/gJxwD1s1LG19k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)