UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AlHl6GrcLkIaQnDydjf+QPEQMb2WtDxbf6S6nce6ok4=' 
WHERE 
  key_id = '18522943e42e6816c185f73973f6b2e250f4455cdfb2211ba18796e60d4df5ff' 
  AND (
    token = 'AlHl6GrcLkIaQnDydjf+QPEQMb2WtDxbf6S6nce6ok4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034