UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kYQKbqwdi4S8k78/ccw8R5N0jz6YjlNBsDKzcd4OAFg=' 
WHERE 
  key_id = '7dd713d963a5a369c9536642d3c68aede684167215b36c28a41009c3eab455a7' 
  AND (
    token = 'kYQKbqwdi4S8k78/ccw8R5N0jz6YjlNBsDKzcd4OAFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018