UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gdQlkZ6yIPvCEAFUcaN+Kk/BgFZfn7uC9T5d1H2qGRs='
WHERE
key_id = '273276d444a25ad5cb0eb7a00daedf86606456b532836435a62513b01c39018c'
AND (
token = 'gdQlkZ6yIPvCEAFUcaN+Kk/BgFZfn7uC9T5d1H2qGRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)