UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+WeA68M+vnmw+wdIvsRXseBKmPpM44CqSB1dP7wi2nk='
WHERE
key_id = '01fbe181f43231fd6b59ff09346e1a150863d4a4fa092b9298e73d049dd13b3f'
AND (
token = '+WeA68M+vnmw+wdIvsRXseBKmPpM44CqSB1dP7wi2nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)