UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LrjYi3Dc0jTA4IXwgQ3m/lR6qQmczgvU3dek116Is/Q='
WHERE
key_id = 'b9f441934abc2d975008ffc20cd18d43373810d0660881d6f7d0ba86457e7d2c'
AND (
token = 'LrjYi3Dc0jTA4IXwgQ3m/lR6qQmczgvU3dek116Is/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)