UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4eRR0/dzkyH9TYe+iTFwI9x+slYeN25sncT3j075p8='
WHERE
key_id = 'e6db8ca098ec6407fcb996e9cfd03f0c98a1b7c45312b00b2f57342a6c12b75f'
AND (
token = '+4eRR0/dzkyH9TYe+iTFwI9x+slYeN25sncT3j075p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)