UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cl1jCv/XJ7VXspuncnPP41wgVHmnDToKBB0Oocvy2PI='
WHERE
key_id = '1ad064408fd346781bbb38b2990260f13e62d7b5732d550cb0dcda7bf24b8b95'
AND (
token = 'cl1jCv/XJ7VXspuncnPP41wgVHmnDToKBB0Oocvy2PI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)