UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2i1v0heQWugrWF9Su4YX02KrHCWtOA1HWuJmet+qMrk='
WHERE
key_id = '45b40de8a2b752dd6d14a72e1d47aa7b607b2f7d07edb53cb1948c6497397a4b'
AND (
token = '2i1v0heQWugrWF9Su4YX02KrHCWtOA1HWuJmet+qMrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)