UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ck+o/OxKpwb4eJkUIwB/ZmQe8SGjsfigtUK6MUfLuK8='
WHERE
key_id = 'b66d92c1901ea100ff63780260e95f6d83832ba303de113f41219681bc253aba'
AND (
token = 'Ck+o/OxKpwb4eJkUIwB/ZmQe8SGjsfigtUK6MUfLuK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)