UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9mus3IsaJB/iBoROphOX0EGQMHf6yLAeMLcGUEWUbf8='
WHERE
key_id = '1a0575d804ac607059fc05da35a38647d145513f09d07603c5797e35528acef6'
AND (
token = '9mus3IsaJB/iBoROphOX0EGQMHf6yLAeMLcGUEWUbf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)