UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3T9K09mhYpxR5NMZfaOI9zcWWGfv1DxV2c34pqkpHyw='
WHERE
key_id = '73c30687fca1837e222903e651d1ae7e9a61e4c9dc9f93808fecabc54543bd3d'
AND (
token = '3T9K09mhYpxR5NMZfaOI9zcWWGfv1DxV2c34pqkpHyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)