UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ICmXxNFgTyzH/w00SN9QyBAB1DsXZp6jSw6kYSNzGnw=' 
WHERE 
  key_id = 'd3269c24141da89a72c76ba3170884c945c13b833f022a85fd1ddc1b2f3e1717' 
  AND (
    token = 'ICmXxNFgTyzH/w00SN9QyBAB1DsXZp6jSw6kYSNzGnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035