UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ETHv00Lplzfcc6dPgeWiM48s6W8R06Bb0SvI/Le+V3Y=' 
WHERE 
  key_id = '733027c6d13ee12561fd5a3ad64e5b609576b6a6cf425e84bb17188508b5a04a' 
  AND (
    token = 'ETHv00Lplzfcc6dPgeWiM48s6W8R06Bb0SvI/Le+V3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041