UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8mmc+mL3tKQWAVHA8p8IlrtB3QO5p4q6RTcu9yOy/o='
WHERE
key_id = 'eee01d9b1c54c63974eaf94c6627f469aa5305f0f2a4819b7cd76889ca446b3f'
AND (
token = '+8mmc+mL3tKQWAVHA8p8IlrtB3QO5p4q6RTcu9yOy/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)