UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/C+uQJaOC0KHkmJHZpoVBT7WKxcsAE4NxRxT8OeKxgc='
WHERE
key_id = '99b96dc5c4dc9d86f538b798adb90cdde4d8c6b260e4a3f4635062e1ef8168d6'
AND (
token = '/C+uQJaOC0KHkmJHZpoVBT7WKxcsAE4NxRxT8OeKxgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)