UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HVnPMM1/eG2jGeVJ3oYpCIjABXP/NeJ0TmggqmqezvI=' 
WHERE 
  key_id = '606f1fdd1ad4f2774434d627e60a2e1b431eebd7768966b3405194dc3c5f288c' 
  AND (
    token = 'HVnPMM1/eG2jGeVJ3oYpCIjABXP/NeJ0TmggqmqezvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032