UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HBBHmyMSd+0Q0SBKXDzYftuZNWrM8AhzK4iyIUUlJ+U='
WHERE
key_id = '25b6e6aae4c29ba0ab1baef216bb765b88ef1d1fe8cb135c077277fed2036b7d'
AND (
token = 'HBBHmyMSd+0Q0SBKXDzYftuZNWrM8AhzK4iyIUUlJ+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)