UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RvBXQkdr6piR9AThlqJs976K2UJnRQAI+99IOWojEe4=' 
WHERE 
  key_id = '19b467e7ee5d8756010e1b81f31033779914c85cc68b72a9b6c93041083e2bcd' 
  AND (
    token = 'RvBXQkdr6piR9AThlqJs976K2UJnRQAI+99IOWojEe4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039