UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HNADt8ZeEMnHR3SBcrqyLIc3MTKzIKjzFaLABp2utzE='
WHERE
key_id = '4fc1dfa3c1d3a1b7a5c593f8eb8493cd22a6cae2702d372ee1ff16dbc2649f56'
AND (
token = 'HNADt8ZeEMnHR3SBcrqyLIc3MTKzIKjzFaLABp2utzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)