UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45dOTno8Xfv/ttwYM1ZT077GkezX2HFhwDoKQnf35i0='
WHERE
key_id = '8344d64e1b1afc1f95e9da9c90c86a489007c431437b7d6d1640b2d1d2023c6c'
AND (
token = '45dOTno8Xfv/ttwYM1ZT077GkezX2HFhwDoKQnf35i0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)