UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZSqbUqVHyIoERWz9ogBx/gMx5WQtKlmrPMq3pkP5SI='
WHERE
key_id = 'f43a62646a3248d5e0267bdb771a8eaf7c958e3f709274b18833ab8a3977fb7d'
AND (
token = 'WZSqbUqVHyIoERWz9ogBx/gMx5WQtKlmrPMq3pkP5SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)