UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6LnwDswUHDR0AlpmB2Tt2eMKPaMlLG0H60Mlt9bpc8='
WHERE
key_id = '618ed28141283f20dc49e1a9c3ab960b2325c806401b027a4861d8507404690f'
AND (
token = 'p6LnwDswUHDR0AlpmB2Tt2eMKPaMlLG0H60Mlt9bpc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)