UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x0Us0C7zOR+gJGm+Zf1PvKue6TXtKhMH9O2EvwX4al0='
WHERE
key_id = 'f24958aa23015669679fbfb52deb4ce9bd88cd45a187a9100db6ee3b558ce1c2'
AND (
token = 'x0Us0C7zOR+gJGm+Zf1PvKue6TXtKhMH9O2EvwX4al0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)