UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fyTKaYV7eaiC8VtHvJED/s46yaSOVnRDq1vBzfO7kWE='
WHERE
key_id = '96589545691f88ab408f15ba2175dd3c1e947f7b01af568838bbad60f7755af1'
AND (
token = 'fyTKaYV7eaiC8VtHvJED/s46yaSOVnRDq1vBzfO7kWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)