UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jLsSH9MWUge33h1I/Gr9sB/Jn7q0+lCkksLV8THKpXc='
WHERE
key_id = '0d2017217648c10b2481d3231be61fb32aa648afd4ca787636a6e3ee4bdec9a7'
AND (
token = 'jLsSH9MWUge33h1I/Gr9sB/Jn7q0+lCkksLV8THKpXc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)