UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eR3953S79VvODB6ZmDhP/swNnMKbJzgstFz5xvEk0gM='
WHERE
key_id = '8d72c8ce8f4cd9d3091e1e16bad27e9ea90e11457f2526112df6c6e430fcd864'
AND (
token = 'eR3953S79VvODB6ZmDhP/swNnMKbJzgstFz5xvEk0gM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)