UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D1lXEZAXYH9JjdmdZ6iyTXuw3DrQv9VpjFycTQ0Zj9k=' 
WHERE 
  key_id = '620399d54fb1234477a159c4a68f091ca1a29fd933d2272f3c50fb357dde0832' 
  AND (
    token = 'D1lXEZAXYH9JjdmdZ6iyTXuw3DrQv9VpjFycTQ0Zj9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029