UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h6C//fav7iu3/6waVwTPqXQHcsHpk3e9s1GIxZhffR8=' 
WHERE 
  key_id = '7d9f08b56b736401d3afe6d0b1a766e4f7f682ebb40a56f692638492f7e2b93a' 
  AND (
    token = 'h6C//fav7iu3/6waVwTPqXQHcsHpk3e9s1GIxZhffR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032