UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XXl1QYAeS/7BdzsobHVhWV45hyVYqomQGazkWyNmQTk='
WHERE
key_id = 'af4346d58adc950273ed18a5fefaee0881e27062865db5a52eee7fb767332935'
AND (
token = 'XXl1QYAeS/7BdzsobHVhWV45hyVYqomQGazkWyNmQTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)