UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IV5Vfs0hRXQUFaRFVvxSQ9P5clGYP0Jy9WNzImpQ7UU='
WHERE
key_id = 'd63d54fcb5bb9d6fc3c7f8bb24a99df6b618ed96eedd99a567e0c4b92460eee1'
AND (
token = 'IV5Vfs0hRXQUFaRFVvxSQ9P5clGYP0Jy9WNzImpQ7UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)