UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/i//BB/k+ewoI6v/Nnc88vnix6ebbVno943ILE/oVII='
WHERE
key_id = 'd481261b085a55cffee69ef2cecc5cf52ffc80a02415074a8770e3876e94ad58'
AND (
token = '/i//BB/k+ewoI6v/Nnc88vnix6ebbVno943ILE/oVII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)