UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'khEcirXTPPlaMzlhnxJ47blTJVqK/rBv3P+5w3YgZP4=' 
WHERE 
  key_id = '55035b849291fb8e9e16013a2e9a99ba0ea7bb0e32d25df3ad07b98e3fe5ea2c' 
  AND (
    token = 'khEcirXTPPlaMzlhnxJ47blTJVqK/rBv3P+5w3YgZP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012