UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bFrWK4vR5Q006BQUi/tWa7K2aGNNA5sdLfvkO1sbqPw=' 
WHERE 
  key_id = 'a43fbe31466c7498a3ceaedea3c026d0a5747c4c7147025f892f1d60cb953c56' 
  AND (
    token = 'bFrWK4vR5Q006BQUi/tWa7K2aGNNA5sdLfvkO1sbqPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034