UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1gmUkB9dauIKwDuo+Pi3vKULoPY7z1Pr+/pcfpEEzTE='
WHERE
key_id = '11b51b137863eb80c25b10363dfbe2b1c4cf1a31ea065b983209372cdb4416da'
AND (
token = '1gmUkB9dauIKwDuo+Pi3vKULoPY7z1Pr+/pcfpEEzTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)