UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JkS9mC9IottwwpCh/jGHF0dplvn8rc6bhqcc/nk5PFg=' 
WHERE 
  key_id = '4f38b1f3d7ca2352f747a41233fbf80e8860daa80bddfc4dfc3e71d728779d02' 
  AND (
    token = 'JkS9mC9IottwwpCh/jGHF0dplvn8rc6bhqcc/nk5PFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036